Kubernetes Web UI
Learn what a Kubernetes dashboard is and how it can be used.
We'll cover the following
Kubernetes Dashboard#
Kubernetes Dashboard is a web-based UI for Kubernetes clusters. It’s not deployed by default with Kubernetes, but running it is fairly straightforward.
A lot of the things that we did with kubectl can also be done through the dashboard, and it is also nice to be able to explore everything we have running in a cluster visually.
To run it, we will use the manifest file provided in the dashboard github repository:
It’s a single manifest file that will create a deployment, service, and the necessary permissions for the dashboard to run. All these resources will be created in the kubernetes-dashboard namespace.
/
Note: Hit on the “RUN” button before clicking on the app link.
After all the resources are created, we should be ready to start using the dashboard. We will create a proxy to be able to connect to the Kubernetes API Server from our local machine:
As we can see from the command output, our proxy is listing on port 8001 locally, so we can use that to connect to the dashboard.
We should be able to open the dashboard in our browser by clicking on the above URL.
Not the easiest thing to remember, but that will do for now.
When we open the URL, we should see the login page.
We have two ways to authenticate: Using a kubeconfig file or with an authentication token. Let’s use a token for now.
In another terminal session, run this command to get the default token:
We can then select Token in the sign in page as the authentication method and use the token that is printed by this command to sign in.
We will see a beautiful dashboard listing everything that is running in our cluster.
From there, for example, you can apply a manifest file using the “Create” button, which will be the same thing as running
kubectl apply -f path/to/file.yaml.
We can also see our containers’ logs, open an interactive session, scale deployments up and down, and a lot more.
We won’t talk about every single feature that is present in this dashboard, but a lot of what we can do with kubectl can also be done there. We can click around and explore it.
This would also work the same way if our cluster were running in a cloud provider; we just run kubectl proxy, and we’ll be able to access it from our local machine without needing to have it exposed to the outside world. How convenient!
Kubernetes IRL
Setting Up Kubernetes Locally